package com.ktjy.gateway.feign;

import com.ktjy.base.R;
import com.ktjy.gateway.feign.fallback.FeignAuthServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 商品接口
 *
 * @author LILIBO
 * @since 2025-02-18
 */
@FeignClient(value = "cloud-center-auth", fallback = FeignAuthServiceFallback.class)
public interface FeignAuthService {

    /**
     * 登录认证
     */
    @PostMapping("/auth/login")
    R login(@RequestParam String username, @RequestParam String password);

    /**
     * 令牌验证
     */
    @PostMapping("/auth/verify")
    R verify(@RequestBody String token);

    /**
     * 退出登录
     */
    @PostMapping("/auth/logout")
    R logout(@RequestParam Long userId);

}
